package com.zhangyongyi.carhome.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;

import com.zhangyongyi.carhome.R;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by dllo on 16/1/7.
 */
public class SplashActivity extends AppCompatActivity {

    private Handler handler;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);

        handler = new Handler(new Handler.Callback() {

            @Override
            public boolean handleMessage(Message msg) {
                Intent intent = new Intent(SplashActivity.this, MainActivity.class);

                startActivity(intent);
                finish();
                return false;
            }
        });
        handler.sendEmptyMessageDelayed(100, 1000);

    }

    //*
    @Override
    protected void onResume() {
        super.onResume();

        JPushInterface.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();

        JPushInterface.onPause(this);
    }
}
